<!DOCTYPE html >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加文件</title>
<link rel="stylesheet" type="text/css" href="../../themes/general.css" 			/>
<link rel="stylesheet" type="text/css" href="../../themes/icon.css" 			/>
<link rel="stylesheet" type="text/css" href="../../themes/jquery-ui.css" 		/>
<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css" 	/>
<script type="text/javascript" src="../../scripts/jquery-1.8.0.min.js"			></script>
<script type="text/javascript" src="../../scripts/jquery.easyui.min.js"			></script>
<script type="text/javascript" src="../../scripts/jqUI/jquery-ui-1.9.2.custom.js"></script>
<script type="text/javascript" src="../../scripts/jqUI/jquery-ui.min.js"		></script>
<script type="text/javascript" src="../../scripts/src/jquery.parser.js"			></script>
<script type="text/javascript" src="../../scripts/locale/easyui-lang-zh_CN.js"	></script>
<script type="text/javascript" src="../../scripts/general.js"					></script>
<script type="text/javascript" src="../../scripts/sessionExpriation.js"			></script>
<script type="text/javascript">
$(function() {
	$('#new_form').form({
		url : '../../file/addFiles.ajax',
		onSubmit : function() {				
			/* if ($(this).form('validate')) {
				return extra_validate();//验证是否为空
			} else {
				return false;
			} */
			alert("test1");
		},
		success : function(data) {
			var obj = $.parseJSON(data);//将json字符串转换为object对象
			if (obj.success) {
				$.messager.alert('提示', obj.message, 'info', function(){
					location.reload();//强迫浏览器刷新当前页面
				});
			} else {
				$.messager.alert('错误', obj.message, 'error');
			}
		}
	});

	//事件绑定，点击提交就提交表单
	$('#btn_submit').bind('click', function() {
		$("#new_form").submit();
	});
});	

function download_file(countNow){
	
	var url = "../../file/downLoadFiles.ajax?fileId=14";
	window.open(url);
}
</script>
</head>
<body>
<form id="new_form" method="post" enctype="multipart/form-data">
	<table class="table_new">
		<tr>
			<td class="td_new_name">文件1</td>
			<td class="td_new_value">
				<input type="file" name="file1" id="file1">
			</td>
			<td class="td_new_name">文件2</td>
			<td class="td_new_value">
				<input type="file" name="file2" id="file2">
			</td>
			<td class="td_new_name">文件3</td>
			<td class="td_new_value">
				<input type="file" name="file3" id="file3">
			</td>

		</tr>
		
	</table>
	<table class="table_new">
		<tr>
			<td align="center" width="100%"><a id="btn_submit" href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok">确认提交</a></td>
		</tr>
	</table>
	</form>
	<a onclick="javascript:download_file()">下载文件</a>
</body>
</html>